﻿<?php


   if ($_POST['nwes']==0){
        echo '<script>alert("没有选择要操作的功能");history.go(-1);</script>';die;
    }

//批量删除功能
if ($_POST['nwes']==1){
       foreach ($_POST['checked'] as $K => $V) {
       $_rows=db_delete('news',$V);
       if ($_rows>0) {
        echo '<script>alert("删除成功");location.href="index.php?c=news&a=list&admin=1"</script>';die;
       }else{
        echo '<script>alert("删除失败");history.go(-1);</script>';die;
        }
       }
  }


   //多条审核状态修改
if ($_POST['nwes']==2){

     print_r($_SERVER['HTTP_X_REQUESTED_WITH']);die;
  if(!empty($_SERVER['HTTP_X_REQUESTED_WITH'])) {
          foreach ($_POST['checked'] as $K => $V) {
        //  // $rows=db_delete('news',$V);
        // $id= $v;
     print_r($V);
        // $achieve= $_POST['achieve'];
        // echo $sql= "update `news`  set `achieve`='$achieve' where id=$id ";die;
        // mysqli_query($link,$sql);
        // $rows=echo mysqli_affected_rows($link);
        // if ($rows>0) {
        //   echo '<script>alert("审核状态修改成功");location.href="index.php?c=news&a=list&admin=1"</script>';die;
        //  }else{
        //   echo '<script>alert("审核状态修改失败");history.go(-1);</script>';die;
          // }
        }

        //  die;
  }


}



?>


